import { StorehouseService } from 'src/app/@core/services/storehouse/storehouse.service';
import { Component } from '@angular/core';
import { TableWidthConfig } from 'ng-devui';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-initial-inventory-detailed',
  templateUrl: './initial-inventory-detailed.component.html',
  styleUrls: ['./initial-inventory-detailed.component.scss']
})
export class InitialInventoryDetailedComponent {
  id:any=null
  detail:any ={}
  tableData:any=[]
  tableWidthConfig: TableWidthConfig[] = [

    {
      field:'物料编码',
      width:'150px'
    },
    {
      field: '物料名称',
      width: '150px'
    },
    {
      field: '物料规格',
      width: '150px'
    },
    {
      field: '单位',
      width: '150px'
    },

    {
      field: '入库数量',
      width: '150px'
    },
    {
      field: '仓库',
      width: '150px'
    },
    {
      field: '库位',
      width: '150px'
    },
    {
      field: '备注',
      width: '150px'
    },
  ];//表格宽度配置
  dataTableOptions = {
    columns: [
      {
        field: '物料编码',
        header: '物料编码',
        fieldType: 'text',
      },
      {
        field: '物料名称',
        header: '物料名称',
        fieldType: 'text',
      },
      {
        field: '物料规格',
        header: '物料规格',
        fieldType: 'text'
      },
      {
        field: '单位',
        header: '单位',
        fieldType: 'text'
      },
      {
        field: '入库数量',
        header: '入库数量',
        fieldType: 'text'
      },
      {
        field: '仓库',
        header: '仓库',
        fieldType: 'text'
      },
      {
        field: '库位',
        header: '库位',
        fieldType: 'text'
      },
      {
        field: '备注',
        header: '备注',
        fieldType: 'text'
      },
    ]
  };//表格数据
  constructor(private StorehouseService:StorehouseService,private route: ActivatedRoute){
    this.route.params.subscribe(params => {
      this.id = params['id'];
    });
  }
  ngOnInit(): void {
    this.StorehouseService.GetOtherWarehousingModel(this.id).subscribe((data:any)=>{
      this.detail = data
      this.tableData = data.otherWarehousingItems
    })
  }
}
